{tpl head}
<div class="searchbar">
  <form action="?" method="get" name="searchListForm">
    <input type="hidden" name="c" value="goods">
    <select class="auto" name="search[category_id]">
      <option value="">选择分类</option>
      {loop $catlist $v}
      <option value="{$v.cat_id}" {if $category_id==$v.cat_id}selected="selected"{/if}>{$v.cat_name}</option>
      {/loop}
    </select>
    <select class="auto" name="search[is_on_sale]">
      <option value="">选择上下架</option>
      <option value="1" {if $is_on_sale==1}selected="selected"{/if}>上架</option>
      <option value="2" {if $is_on_sale==2}selected="selected"{/if}>下架</option>
      <option value="3" {if $is_on_sale==3}selected="selected"{/if}>待审</option>
    </select>
    <select class="auto" name="search[store_nums]">
      <option value="">选择库存</option>
      <option value="g.store_nums < 1">无货</option>
      <option value="g.store_nums >= 1 and g.store_nums < 10">低于10</option>
      <option value="g.store_nums <= 100 and g.store_nums >= 10">10-100</option>
      <option value="g.store_nums >= 100">100以上</option>
    </select>
    <select class="auto" name="search[commend_id]">
      <option value="">选择商品标签</option>
      <option value="1" {if $commend_id==1}selected="selected"{/if}>最新商品</option>
      <option value="2" {if $commend_id==2}selected="selected"{/if}>特价商品</option>
      <option value="3" {if $commend_id==3}selected="selected"{/if}>热卖商品</option>
      <option value="4" {if $commend_id==4}selected="selected"{/if}>推荐商品</option>
    </select>
    <button class="btn" type="submit" onclick="changeAction(false)"><span class="sel">筛 选</span></button>
    <!--<button class="btn" onclick="changeAction(true)"><span class="sel">导出Excel</span></button>-->
  </form>
</div>
<table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
	<thead>
<tr class="n_bt"><td colspan="8" align="center">工作小助手系统</td></tr>
  <tr>
  <td height="28" align="center"  class="thbt">栏目ID</td>
    <td height="28" align="center"  class="thbt">商品名称</td>
    <td height="28" align="center"  class="thbt">分类</td>
    <td height="28" align="center"  class="thbt">销售价</td>
    <td height="28" align="center"  class="thbt">库存</td>
    <td height="28" align="center"  class="thbt">状态</td>
    <td height="28" align="center"  class="thbt">排序</td>
    <td height="28" align="center"  class="thbt">管理选项</td>
 
  </tr></thead>

  <tbody id="goodsListBody"></tbody>
  <script id="goodsRowTemplate" type="text/html">
    <%for(var item in templateData){%>
    <%item = templateData[item]%>
    <tr width='4%' align="center" >
      <td><input name="id[]" type="checkbox" value="<%=item['id']%>"><%=item['id']%></td>
      <td height="20" align="left"><%=item['name']%></td>
      <td><%=item['cat_name']%></td>
      <td><%=item['sell_price']%></td>
      <td><%=item['store_nums']%></td>
      <td><% if (item['is_on_sale']==1){%>上架<%}else if(item['is_on_sale']==2){%>审核<%}else{%>下架<%}%></td>
      <td><%=item['sort']%></td>
      <td><a class="mod" href="?c={$classname}&a=info&id=<%=item['id']%>">修改</a>
        <a class="del" href="?c={$classname}&a=del&id=<%=item['id']%>">删除</a></td>
      </td>
    </tr>
    <%}%>
  </script>
</table>
<div class="pages">{$pagelist}</div>
<script type="text/javascript">
  $(function()
  {
    var t={$goodslist};
    console.log(t);
    var goodsRowHtml = template.render('goodsRowTemplate',{'templateData':{$goodslist}});
    $('#goodsListBody').html(goodsRowHtml);
  });
</script>
{tpl foot}